{$CLEO}

0A95: enable_thread_saving



while true
    wait 0
    3@ = false                                                                                                                                                                                                        
    #patriot.Load                                                                                                                                                                                                     
    #fam3.load                                                                                                                                                                                                         
    #mp5lng.load                                                                                                                                                                                                       
    038b:                                                                                                                                                                                                              
    while true                                                                                                                                                                                                         
    repeat                                                                                                                                                                                                             
    wait 0                                                                                                                                                                                                             
    until if player.Defined(0)                                                                                                                                                                                         
    09E8: $GYMFIGHT_INTERIOR = actor $PLAYER_ACTOR active_interior                                                                                                                                                     
    if $GYMFIGHT_INTERIOR == 0                                                                                                                                                                                        
    then                                                                                                                                                                                                               
        if 3@ == false                                                                                                                                                                                                
        then                                                                                                                                                                                                     
            0208: 6@ = random_float_in_ranges 50.2 100.2                                                                                                                                                               
            0208: 7@ = random_float_in_ranges 50.2 100.2                                                                                                                                                               
            04C4: store_coords_to 0@ 1@ 2@ from_actor $PLAYER_ACTOR with_offset 6@ 7@ -1.0                                                                                                                             
            04D3: get_nearest_car_path_coords_from 0@ 1@ 2@ type 0 store_to 6@ 7@ 8@                                                                                                                                   
            4@ = car.Create(#patriot,6@,7@,8@)                                                                                                                                                                        
            Car.Angle(4@) = 184.7214                                                                                                                                                                                   
            Car.SetMaxSpeed(4@, 253.0)                                                                                                                                                                                 
            Car.DoorStatus(4@) = 1                                                                                                                                                                                     
            car.Health(4@) = 20000                                                                                                                                                                                     
            00AE: set_car 4@ traffic_behaviour_to 2                                                                                                                                                                    
            Car.SetDriverBehaviour(4@, drivetoplayer)                                                                                                                                                                  
            053F: set_car 4@ tires_vulnerability 0                                                                                                                                                                     
            01EC: make_car 4@ very_heavy 1                                                                                                                                                                             
            Car.SetImmunities(4@, 0, 1, 0, 1, 1)                                                                                                                                                                       
            //5@ = marker.CreateAboveCar($VEH_HDL)                                                                                                                                                                           
            0587: enable_car 4@ validate_position 0                                                                                                                                                                    
            15@ = Actor.CreateAsDriver(gang2, #fam3, 4@)                                                                                                                                                                  
            17@ = Actor.CreateAsPassenger(gang2, #fam3, 4@, 0)
            24@ = Actor.CreateAsPassenger(gang2, #fam3, 4@, 1)
            27@ = Actor.CreateAsPassenger(gang2, #fam3, 4@, 2)
            0446: set_actor 17@ dismemberment_possible 0
            0446: set_actor 15@ dismemberment_possible 0
            0446: set_actor 24@ dismemberment_possible 0
            0446: set_actor 27@ dismemberment_possible 0
            Actor.Health(15@) = 1000     
            Actor.Health(17@) = 1000     
            Actor.Health(24@) = 1000     
            Actor.Health(27@) = 1000     
            car.DoorStatus(4@, 4)      
                                                                                                                                                                        
            28@ = actor.Create(gang2, #fam3, 6@,7@,8@)                                                                                                                                                                   
            Actor.SetImmunities(28@, 0, 0, 0, 0, 0)
            Actor.Health(28@) = 1000                                                                                                                                                                       
            0619: enable_actor 28@ collision_detection 0                                                                                                                                                               
            29@ = Object.Create(2985, 0.0, 0.0, -25.0)                                                                                                                                                                 
            Object.CollisionDetection(29@) = False                                                                                                                                                                     
            0400: store_coords_to 0@ 1@ 2@ from_actor 29@ with_offset 0.0 2.0 1.1                                                                                                                                      
            Object.PutAt(29@, 0@ 1@ 2@)                                                                                                                                                                                
            0681: attach_object 29@ to_car 4@ with_offset 0.0 -1.0 0.5 rotation 0.0 0.0 0.0                                                                                                                            
            06A7: put_actor 28@ into_turret_on_car 4@ at_car_offset 0.0 -1.5 1.2 position 1 shooting_angle 100.0 360.0 with_weapon 0                                                                                   
            0638: AS_actor 28@ stay_put 1                                                                                                                                                                              
            04F4: put_actor 28@ into_turret_on_object 29@ offset_from_object_origin -0.5 0.0 0.7 orientation 0 both_side_angle_limit 360.0 lock_weapon 0                                                                                                                                                                                                                            
            072F: enable_car 4@ stuck_check_distance 0.5 time 4000 and_restore_if stuck 1 flipped 1 unk_place_on_road_properly 1 to_path 7 // extended 03CC                                                                                                                 
            0190: add_car 4@ to_flipped_check // 6 max                                                                                                                                                                                                         
            Car.SetDriverBehaviour(4@, drivetoplayer)
            0978: copy_decision_maker 65540 to 22@ 
            0709: set_decision_maker 22@ on_event 36 taskID 1022 respect 0.0 hate 100.0 like 0.0 dislike 0.0 in_car 1 on_foot 0 // see *.ped files 
            0709: set_decision_maker 22@ on_event 37 taskID 1022 respect 0.0 hate 100.0 like 0.0 dislike 0.0 in_car 1 on_foot 0 // see *.ped files 
            0709: set_decision_maker 22@ on_event 36 taskID 1024 respect 0.0 hate 50.0 like 0.0 dislike 0.0 in_car 0 on_foot 1 // see *.ped files 
            060B: set_actor 17@ decision_maker_to 22@
            060B: set_actor 24@ decision_maker_to 22@ 
            060B: set_actor 27@ decision_maker_to 22@
            for 6@ = 0 to 22 step 1
                if and
                    not 6@ == 0
                    not 6@ == 8
                     not 6@ == 4
                      not 6@ == 5
                jf continue 
                077A: set_actor 17@ acquaintance 4 to_actors_pedtype 6@ // see ped.dat          
                077A: set_actor 24@ acquaintance 4 to_actors_pedtype 6@ // see ped.dat    
                077A: set_actor 27@ acquaintance 4 to_actors_pedtype 6@ // see ped.dat    
            end
            if 056D:   actor 15@ defined                                                                                                                                                                                
            then                                                                                                                                                                                                       
                if not Actor.HasWeapon(15@, 29)                                                                                                                                                                         
                then Actor.GiveWeaponAndAmmo(15@, 29, 999999)                                                                                                                                                           
                end                                                                                                                                                                                                    
            end                                                                                                                                                                                                        
            if 056D:   actor 17@ defined                                                                                                                                                                                
            then                                                                                                                                                                                                       
                if not Actor.HasWeapon(17@, 29)                                                                                                                                                                         
                then Actor.GiveWeaponAndAmmo(17@, 29, 999999)                                                                                                                                                           
                end                                                                                                                                                                                                    
            end
            if 056D:   actor 24@ defined                                                                                                                                                                                
            then                                                                                                                                                                                                       
                if not Actor.HasWeapon(24@, 29)                                                                                                                                                                         
                then Actor.GiveWeaponAndAmmo(24@, 29, 999999)                                                                                                                                                           
                end                                                                                                                                                                                                    
            end                 
            if 056D:   actor 27@ defined                                                                                                                                                                                
            then                                                                                                                                                                                                       
                if not Actor.HasWeapon(27@, 29)                                                                                                                                                                         
                then Actor.GiveWeaponAndAmmo(27@, 29, 999999)                                                                                                                                                           
                end                                                                                                                                                                                                    
            end                                                                                                                                                                                                                         
            3@ = true                                                                                                                                                                                                 
            21@ = 1                                                                                                                                                                                                   
        end                                                                                                                                                                                                            
        if 3@ == true                                                                                                                                                                                                 
        then                                                                                                                                                                                                           
            if 056E:   car 4@ defined                                                                                                                                                                                  
            then                                                                                                                                                                                                       
                if 056D:   actor 28@ defined                                                                                                                                                                          
                then 
                    if not Actor.Animation(28@) == "DRIVE_R_SLOW"
                    then 0812: AS_actor 28@ perform_animation "DRIVE_R_SLOW" "ped" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1                                                                                                                                                                                                                       
                    end
                    if 01F4:   car 4@ flipped                                                                                                                                                                          
                    then car.Angle(4@) = 0.0                                                                                                                                                                            
                    end                                                                                                                                                                                                
                    if 03ca:   actor 29@ defined                                                                                                                                                                       
                    then object.StorePos(29@, 26@, 25@, 23@)                                                                                                                                                            
                    end                                                                                                                                                                                                
                    gosub @get_criminal0                                                                                                                                                                                
                    if 056D:   actor 31@ defined                                                                                                                                                                       
                    then                                                                                                                                                                                               
                        if not actor.Dead(31@)                                                                                                                                                                         
                        jf @sss                                                                                                                                                                                                 
                        Actor.StorePos(31@, 10@, 20@, 2@)
                        :sss
                    end
                    GOSUB @SET_MINIGUN0                                                                                                                                                                 
                    if and                                                                                                                                                                                         
                    0471:   actor 28@ near_object_in_rectangle 29@ radius 2.0 2.0 sphere 0                                                                                                                         
                    03ca:   actor 29@ defined                                                                                                                                                                      
                    then //0acd: "000" 100
                        0087: 19@ = 30@
                        19@ += 10.0                                                                                                                                                                         
                        0681: attach_object 29@ to_car 4@ with_offset 0.0 -1.0 0.5 rotation 0.0 19@ 11@                                                                                                            
                        11@ = object.Angle(29@)                                                                                                                                                                    
                        11@ -= 94.0                                                                                                                                                                                
                        actor.Angle(28@) = 11@                                                                                                                                                                     
                        if not Actor.Animation(28@) == "DRIVE_R_SLOW"
                        then 0812: AS_actor 28@ perform_animation "DRIVE_R_SLOW" "ped" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1                                                                                                                                                                                                                       
                        end                                                                                                                                                                      
                        if 21@ == 2                                                                                                                                                                               
                        then 
                            if 056D:   actor 31@ defined                                                                                                                                                                       
                            then                                                                                                                                                                                   
                                if not actor.Dead(31@)                                                                                                                                                             
                                then               
                                    0393: actor 28@ perform_animation "DRIVE_R_SLOW" at 1.0 times_normal_rate                                                                                          
                                    0208: 5@ = random_float_in_ranges -1.0 1.0                                                                                                                                                                                                            
                                    0208: 6@ = random_float_in_ranges -1.0 1.0                                                                                                                                     
                                    0400: store_coords_to 26@ 25@ 18@ from_car 29@ with_offset 0.8 0.0  1.1                                                                                                        
                                    04C4: store_coords_to 10@ 20@ 23@ from_car 31@ with_offset 5@ 0.0 6@                                                                                               
                                    06BC: create_M4_shoot_from 26@ 25@ 18@ target 10@ 20@ 23@ energy 100                                                                                               
                                    066E: create_particle "GUNFLASH" attached_to_object 29@ with_offset 0.8 0.0  1.1 rotation  0.866024961519 0 0.500000766025 flag 1 handle_as 0@                                 
                                    064C: make_particle 0@ visible                                                                                                                                                 
                                    064F: remove_references_to_particle 0@                                                                                                                                         
                                    097B: play_audio_at_object 29@ event 1157                                                                                                                          
                                else 14@ = false
                                end
                            else 14@ = false
                            end            
                        end                                                                                                                                                                                        
                        IF 21@ == 1                                                                                                                                                                               
                        THEN //0acd: "firing" 100                                                                                                                                                                                    
                            IF NOT 9@ >= 50                                                                                                                                                                      
                            THEN 9@ += 1                                                                                                                                                                         
                            ELSE 21@ = 2                                                                                                                                                                          
                            END                                                                                                                                                                                    
                        END                                                                                                                                                                                        
                        IF 21@ == 2                                                                                                                                                                               
                        THEN //0acd: "wait" 100   
                            0393: actor 28@ perform_animation "DRIVE_R_SLOW" at 0.0 times_normal_rate                                                                                                                                                                                            
                            IF 9@ > 0                                                                                                                                                                            
                            THEN 9@ -= 1                                                                                                                                                                         
                            end                                                                                                                                                                                    
                        END                                                                                                                                                                                        
                        IF 9@ == 1                                                                                                                                                                               
                        THEN 21@ = 1                                                                                                                                                                              
                        END                                                                                                                                                                                        
                    end                                                                                                                                                                                            
                end
                0AB4: 16@ < 569                                                                                                                                                                                                   
                if or                                                                                                                                                                                                  
                    8202:   not actor $PLAYER_ACTOR near_car 4@ radius 200.0 200.0 sphere 0                                                                                                                            
                    car.Wrecked(4@)
                    16@ == TRUE                                                                                                                                                                                    
                then                                                                                                                                                                                                   
                    3@ = false                                                                                                                                                                                        
                    if 056E:   car 4@ defined                                                                                                                                                                          
                    then car.RemoveReferences(4@)                                                                                                                                                                      
                    end                                                                                                                                                                                                
                    if 056D:   actor 15@ defined                                                                                                                                                                        
                    then Actor.RemoveReferences(15@)                                                                                                                                                                    
                    end                                                                                                                                                                                                
                    if 056D:   actor 17@ defined                                                                                                                                                                        
                    then Actor.RemoveReferences(17@)                                                                                                                                                                    
                    end
                    if 056D:   actor 24@ defined                                                                                                                                                                        
                    then Actor.RemoveReferences(24@)                                                                                                                                                                    
                    end                                                                                                                                                                                                
                    if 056D:   actor 27@ defined                                                                                                                                                                        
                    then Actor.RemoveReferences(27@)                                                                                                                                                                    
                    end                                                                                                                                                                                                                                               
                    if 056D:   actor 28@ defined                                                                                                                                                                       
                    then Actor.RemoveReferences(28@)                                                                                                                                                                   
                    end                                                                                                                                                                                                      
                    IF 03CA:   object 29@ exists                                                                                                                                                                       
                    THEN object.RemoveReferences(29@)                                                                                                                                                                  
                    END                                                                                                                                                                                                
                    end_thread                                                                                                                                                                                               
                end                                                                                                                                                                                                    
            end                                                                                                                                                                                                        
            if actor.Dead(17@)                                                                                                                                                                                      
            then                                                                                                                                                                                                       
                if 056D:   actor 17@ defined                                                                                                                                                                       
                then Actor.RemoveReferences(17@)                                                                                                                                                                        
                end                                                                                                                                                                                                    
            else                                                                                                                                                                                                        
                if actor.Dead(15@)                                                                                                                                                                                  
                then                                                                                                                                                                                                   
                    if 056D:   actor 15@ defined                                                                                                                                                                   
                    then Actor.RemoveReferences(15@)                                                                                                                                                                    
                    end                                                                                                                                                                                                
                else                                                                                                                                                                                                   
                    if actor.Dead(28@)                                                                                                                                                                             
                    then                                                                                                                                                                                               
                        if 056D:   actor 28@ defined                                                                                                                                                              
                        then Actor.RemoveReferences(28@)                                                                                                                                                               
                        end                                                                                                                                                                                            
                    else                                                
                        if actor.Dead(24@)                                                                                                                                                                         
                        then                                                                                                                                                                                           
                            else if 056D:   actor 24@ defined                                                                                                                                                          
                            then Actor.RemoveReferences(24@)                                                                                                                                                           
                            end                                                                                                                                                                                        
                        else                                                     
                            if not actor.Dead(27@)                                                                                                                                                                     
                            then                                                                                                                                                                                       
                                else if 056D:   actor 27@ defined                                                                                                                                                      
                                then Actor.RemoveReferences(27@)                                                                                                                                                       
                                end                                                                                                                                                                                    
                            end
                        end
                    end
                end
            end                                                                                                                                                                                                       
        end                                                                                                                                                                                                            
    end                                                                                                                                                                                                                
end


                    
                    :SET_MINIGUN0                                                                                                                                                                
                    050A: 1@ = distance_between_XYZ 26@ 25@ 23@ and_XYZ 10@ 20@ 2@                                                                                                                                 
                    0087: 13@ = 2@ // (float)                                                                                                                                                                       
                    0063: 13@ -= 23@ // (float)                                                                                                                                                                     
                    0073: 13@ /= 1@ // (float) = sin                                                                                                                                                                
                    0087: 14@ = 13@ // (float)                                                                                                                                                                       
                    0087: 30@ = 13@ // (float)                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    13@ /= 6.0                                                                                                                                                                                      
                    005B: 30@ += 13@ // (float)                                                                                                                                                                     
                    13@ *= 6.0                                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    13@ *= 0.075                                                                                                                                                                                    
                    005B: 30@ += 13@ // (float)                                                                                                                                                                     
                    13@ /= 0.075                                                                                                                                                                                    
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    13@ *= 0.0446                                                                                                                                                                                   
                    005B: 30@ += 13@ // (float)  arcsinX = X + (X^3)/6 + (X^5)*3/40 + (X^7)*15/336                                                                                                                  
                    30@ *= -57.296 // ia?aei ?aeau  a?anu                                                                                                                                                  
                    30@ += 350.0                                                                                                                                                                                   
                    0063: 10@ -= 26@ // (float)                                                                                                                                                                    
                    0063: 20@ -= 25@ // (float)                                                                                                                                                                    
                    0604: get_Z_angle_for_point 10@ 20@ store_to 11@  // 1 ia?aiao? - x2-x1   2 ia?aiao? - y2-y1                                                                                                   
                    //-----------------------------------------------------------uenyai niauaey i nyi X e Y                                                                                                  
                    0174: 12@ = car 4@ Z_angle                                                                                                                                                                     
                    0063: 11@ -= 12@ // (float)                                                                                                                                                                    
                    11@ += 270.0   // ino ieeaa ao ?aniaaaony ni?aa o y ioee                                                                                                                    
                    02F6: 10@ = cosine 11@ // (float) nen                                                                                                                                                        
                    02F7: 20@ = sine 11@ // (float) enen                                                                                                                                                        
                    10@ *= -0.3                                                                                                                                                                                    
                    20@ *= 0.4                                                                                                                                                                                     
                    //-----------------------------------------------------------i?ee?aiyai ieeaa                                                                                                               
                    11@ -= 180.0                                                                                                                                                                                   
                    if 30@ < 320.0                                                                                                                                                                                 
                    then 30@ = 320.0                                                                                                                                                                               
                    end                                                                                                                                                                                            
                    if 30@ > 395.0                                                                                                                                                                                 
                    then 30@ = 395.0                                                                                                                                                                               
                    end
                    RETURN                           

:get_criminal0
if or
   14@ == false
   33@ >= 5000
then 33@ = 0
    Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@)                                                                            
    if 0AE1: 31@ = random_actor_near_point 0@ 1@ 2@ in_radius 200.0 find_next 1 pass_deads 0 //IF and SET                
    then                                                                                                                                                              
        IF NOT 31@ == -1                                                                                                                                               
        then                                                                                                                                        
            IF 056D:   actor 31@ defined                                                                                                                               
            then                                                                                                         
                089F: get_actor 31@ pedtype_to 13@ 
                if and
                    not 13@ == 8
                    not 13@ == 4
                    not 13@ == 5
                    not 13@ == 6
                then 14@ = true
                else 
                    31@ = -1
                    14@ = false
                end
                IF PLAYER.WantedLevel(0) > 0
                THEN
                    if and                             
                        not 13@ == 8                   
                        not 13@ == 4                   
                        not 13@ == 5                   
                    then 14@ = true                    
                    else                               
                        31@ = -1                       
                        14@ = false                    
                    end                                
                END                                                                                         
            end                                                                                                          
        end                                                                                                              
    end                                                                                                                  
end
return
end_thread